package com.zhoug.commonlib2;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.LayoutRes;
import androidx.appcompat.app.AppCompatActivity;

public abstract class MyBaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutResId());
        findViews();
        onCreate1(savedInstanceState);
    }

    protected abstract @LayoutRes int getLayoutResId();

    protected abstract void findViews();

    protected abstract void onCreate1(Bundle savedInstanceState);

    protected MyBaseActivity getActivity() {
        return this;
    }

    protected void toActivity(Class<? extends Activity> clazz) {
        Intent intent = new Intent(this, clazz);
        startActivity(intent);
    }

}
